<?php
    $mysql=new MySqli('121.37.171.2', 'sql_5p8_fyh5p8_c', 'XKjeShLWexejJ32A','sql_5p8_fyh5p8_c');
    $rows_sql = $mysql->query("select * from dyspw_weblink");
    $rows = $rows_sql->fetch_all(MYSQLI_ASSOC);
    foreach ($rows as $key => $val) {
        if($val['hits'] < 6000){
            $num = mt_rand(100,400);
            $num = $val['hits'] + $num;
            $goods_add = $mysql->query("UPDATE dyspw_weblink SET hits='{$num}' where id={$val['id']}");
        }
    }
 ?>
